POV-Ray : Newsgroups : povray.general : problem: repeating rand patterns using seed in animation : Re: problem: repeating rand patterns using seed in animation Server Time
30 Jul 2024 18:20:30 EDT (-0400)
  Re: problem: repeating rand patterns using seed in animation  
From: Kenneth
Date: 25 Jan 2009 20:15:01
Message: <web.497d0d60b528db0df50167bc0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Kenneth <kdw### [at] earthlinknet> wrote:
> > "Kenneth" <kdw### [at] earthlinknet> wrote:
> > > "Chris B" <nom### [at] nomailcom> wrote:
> > > >
> > > > #declare P = seed(1);
> > > > #local I = 0;
> > > > #while (I<frame_number)
> > > > #local ThrowAway = rand(P);
> > > > #declare I = I + 1; // added by Kenneth  ;-)
> > > > #end
> > >
> > > That's quite interesting, and it makes great sense--it pulls a nice
> > > random value for each frame. I'll try it!
>
> > Yes indeed, it works as advertised. Wonderful! Who cares if it wastes
> > some rand values; that's what computers are FOR! :-P
>
>   Actually it doesn't waste any values. In fact, the end result is very
> similar to the #write/#read solution, but without having to use the temporary
> file.
>
>   Or it is, if you only want one random value per frame. If you want several
> random values per frame, then you have to "read away" all the random values
> from the RNG stream that have been used in previous frames.
>
But isn't that what happens when needing just one real rand value per frame?
Given Chris B's #while loop, each new animation frame discards all the previous
frames' rand values, in order to come up with a fresh new one. (That's what I
meant by 'wasting values.') So by frame 100, the previous 99 generated values
have been discarded, as a necessity. Please clue me in if I'm not understanding
your argument clearly.

KW


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.